package com.beans;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;




@Controller
public class UserController {
//    @Resource(name = "User1")
    @Autowired
    @Qualifier(value = "User1")
    private User user1;

//    @Resource(name = "User2")
    @Autowired
    @Qualifier(value = "User2")
    private User user2;

    public  void  sayHi(){
        System.out.println("User ->" + user1);
        System.out.println("User ->" + user2);
    }
}
